<!-- #section:basics/sidebar -->
<div id="sidebar" class="sidebar                  responsive">
    <script type="text/javascript">
        try {
            ace.settings.check('sidebar', 'fixed')
        } catch (e) {
        }
    </script>

    <!--    <div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                <button class="btn btn-success">
                    <i class="ace-icon fa fa-signal"></i>
                </button>
    
                <button class="btn btn-info">
                    <i class="ace-icon fa fa-pencil"></i>
                </button>
    
                 #section:basics/sidebar.layout.shortcuts 
                <button class="btn btn-warning">
                    <i class="ace-icon fa fa-users"></i>
                </button>
    
                <button class="btn btn-danger">
                    <i class="ace-icon fa fa-cogs"></i>
                </button>
    
                 /section:basics/sidebar.layout.shortcuts 
            </div>
    
            <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                <span class="btn btn-success"></span>
    
                <span class="btn btn-info"></span>
    
                <span class="btn btn-warning"></span>
    
                <span class="btn btn-danger"></span>
            </div>
        </div> /.sidebar-shortcuts -->

    <ul class="nav nav-list">
        <?php $lastLevel = 0; ?>
        <?php foreach ($menuList as $key => $row): ?>
            <?php
            for ($i = $row['level']; $i < $lastLevel; $i++) {
                echo "\n</ul>\n</li>";
            }
            ?>
            <li class="<?php if (in_array($row['authority_id'], $parentList)) echo empty($row['sub_authority']) ? 'active' : 'active open'; ?>">
                <a href="<?php echo empty($row['sub_authority']) ? $row['authority_uri'] : "#"; ?>" <?php if (!empty($row['sub_authority'])) echo 'class="dropdown-toggle"'; ?> >
                    <i class="menu-icon fa <?php echo $row['level'] == 0 ? $row['menu_icon'] : "fa-caret-right"; ?>"></i>
                    <?php if ($row['level'] == 0) : ?>
                        <span class="menu-text"><?php echo $row['authority_name']; ?></span>
                    <?php else: ?>
                        <?php echo $row['authority_name'] . "\n"; ?>
                    <?php endif; ?>
                    <?php if (!empty($row['sub_authority'])) echo '<b class="arrow fa fa-angle-down"></b>'; ?> 
                </a>
                <b class="arrow"></b>

                <?php
                if (empty($row['sub_authority'])) {
                    echo "</li>";
                } else {
                    echo '<ul class="submenu">';
                }
                ?>

                <?php $lastLevel = $row['level']; ?>
            <?php endforeach; ?>

            <?php
            for ($i = 1; $i <= $lastLevel; $i++) {
                echo "\n</ul>\n</li>";
            }
            ?>
    </ul><!-- /.nav-list -->

    <!-- #section:basics/sidebar.layout.minimize -->
    <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
        <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>

    <!-- /section:basics/sidebar.layout.minimize -->
    <script type="text/javascript">
        try {
            ace.settings.check('sidebar', 'collapsed')
        } catch (e) {
        }
    </script>
</div>

<!-- /section:basics/sidebar -->
